﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Visifire.Gauges;

namespace CPPEI.Coolzon.UI.DataPartLib
{
    public partial class DataGaugeDoubleCircularScale
    {
        public MajorTicks GetMajor2Ticks()
        {
            MajorTicks major2Ticks = new MajorTicks();
            major2Ticks.Visibility = IsMajor2TicksEnabled ? Visibility.Visible : Visibility.Collapsed;
            major2Ticks.Background = Major2TicksBackground==null? null : Major2TicksBackground.Brush;
            major2Ticks.BorderBrush = Major2TicksBorderBrush==null? null : Major2TicksBorderBrush.Brush;
            major2Ticks.BorderThickness = Major2TicksBorderThickness;
            major2Ticks.Placement = Major2TicksPlacement;
            major2Ticks.Shape = Major2TicksShape;
            major2Ticks.TickLength = Major2TicksTickLength;
            major2Ticks.TickWidth = Major2TicksTickWidth;

            return major2Ticks;
        }
        private BrushEx major2TicksBackground;
        private BrushEx major2TicksBorderBrush;
        private Thickness major2TicksBorderThickness;
        private PlacementTypes major2TicksPlacement;
        private Shapes major2TicksShape;
        private double? major2TicksTickLength;
        private double? major2TicksTickWidth;

        [Category("第二表盘主要刻度")]
        [DisplayName("第二表盘主要刻度背景颜色")]
        [Description("Major2TicksBackground")]
        [Editor(typeof(UI.XProperty.Editors.XBrushEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "Major2TicksBackground", "主要刻度背景颜色")]
        public BrushEx Major2TicksBackground
        {
            get
            {
                return major2TicksBackground;
            }

            set
            {
                major2TicksBackground = value;
                Refresh();
            }
        }

        [Category("第二表盘主要刻度")]
        [DisplayName("第二表盘主要刻度边框颜色")]
        [Description("Major2TicksBorderBrush")]
        [Editor(typeof(UI.XProperty.Editors.XBrushEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "Major2TicksBorderBrush", "主要刻度边框颜色")]
        public BrushEx Major2TicksBorderBrush
        {
            get
            {
                return major2TicksBorderBrush;
            }

            set
            {
                major2TicksBorderBrush = value;
                Refresh();
            }
        }

        [Category("第二表盘主要刻度")]
        [DisplayName("第二表盘主要刻度边框大小")]
        [Description("Major2TicksBorderThickness")]
        [Editor(typeof(UI.XProperty.Editors.XThicknessEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "Major2TicksBorderThickness", "主要刻度边框大小")]
        public Thickness Major2TicksBorderThickness
        {
            get
            {
                return major2TicksBorderThickness;
            }

            set
            {
                major2TicksBorderThickness = value;
                Refresh();
            }
        }

        [Category("第二表盘主要刻度")]
        [DisplayName("第二表盘主要刻度位置")]
        [Description("Major2TicksPlacement")]
        [Editor(typeof(UI.DataPartLib.XProperty.Editors.XPlacementTypesEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "Major2TicksPlacement", "主要刻度位置")]
        public PlacementTypes Major2TicksPlacement
        {
            get
            {
                return major2TicksPlacement;
            }

            set
            {
                major2TicksPlacement = value;
                Refresh();
            }
        }


        [Category("第二表盘主要刻度")]
        [DisplayName("第二表盘主要刻度形状")]
        [Description("Major2TicksShape")]
        [Editor(typeof(UI.DataPartLib.XProperty.Editors.XShapesEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "Major2TicksShape", "主要刻度形状")]
        public Shapes Major2TicksShape
        {
            get
            {
                return major2TicksShape;
            }

            set
            {
                major2TicksShape = value;
                Refresh();
            }
        }

        [Category("第二表盘主要刻度")]
        [DisplayName("第二表盘主要刻度长度")]
        [Description("Major2TicksTickLength")]
        [Editor(typeof(UI.XProperty.Editors.XDoubleNullEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "Major2TicksTickLength", "主要刻度长度")]
        public double? Major2TicksTickLength
        {
            get
            {
                return major2TicksTickLength;
            }

            set
            {
                major2TicksTickLength = value;
                Refresh();
            }
        }

        [Category("第二表盘主要刻度")]
        [DisplayName("第二表盘主要刻度宽度")]
        [Description("Major2TicksTickWidth")]
        [Editor(typeof(UI.XProperty.Editors.XDoubleNullEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "Major2TicksTickWidth", "主要刻度宽度")]
        public double? Major2TicksTickWidth
        {
            get
            {
                return major2TicksTickWidth;
            }

            set
            {
                major2TicksTickWidth = value;
                Refresh();
            }
        }

        [Category("第二表盘主要刻度")]
        [DisplayName("第二表盘主要刻度是否显示")]
        [Description("IsMajor2TicksEnabled")]
        [Editor(typeof(UI.XProperty.Editors.XBooleanEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "IsMajor2TicksEnabled", "主要刻度是否显示")]
        public bool IsMajor2TicksEnabled
        {
            get
            {
                return isMajor2TicksEnabled;
            }

            set
            {
                isMajor2TicksEnabled = value;
                Refresh();
            }
        }

        private bool isMajor2TicksEnabled;
    }
}
